package com.service;
import com.dao.NoticeDao;
import com.dao.UserDao;
import com.pojo.Notice;

import com.pojo.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

import org.springframework.stereotype.Service;

@Service
public class NoticeService {
    @Resource
    private NoticeDao noticeDao;
    public List<Notice>queryNotice(){
        return   noticeDao.queryNoticeAll();
    }

    public int addNotice(Notice notice) {
        return   noticeDao.addNotice(notice);
    }

    public List<Notice> queryNoticeByTitle(String title) {
        return     noticeDao.queryNoticeByTitle(title);
    }

    public int updateNotice(Notice notice) {
        return noticeDao.updateNotice(notice);
    }

    public int deleteNotice(int id){return noticeDao.deleteNotice(id); }
    public int countAll(String title,String user_id){
        return noticeDao.countAll(title,user_id);
    }
    public int countTitle(String title){
        return noticeDao.countTitle(title);}
        public int countId(String user_id){
        return noticeDao.countId(user_id);
        }
    public List<Notice> queryFen(int pageindex, int pagesize){
        return noticeDao.queryFen(pageindex, pagesize);
    }
    public List<Notice> queryTitle(int pageindex, int pagesize,String title,String user_id){
        return noticeDao.queryTitle(pageindex, pagesize,title,user_id);
    }
    /*public List<Notice> queryId(int pageindex, int pagesize,String user_id){
        return  noticeDao.queryId(pageindex,pagesize,user_id);
    }*/
}
